import pyautogui
import time
# print 'Press Ctrl-C to quit.'
# 获取鼠标坐标
try:
    while True:
        pyautogui.position()
        # TODO: Get and print the mouse coordinates.
        print('X:', pyautogui.mouseInfo(), 'Y:')
        time.sleep(1)
except KeyboardInterrupt:
    print('\nDone.')